<include file="public:header" />
<div class="toptip">
    <div class="toptit">提示：</div>
    <p>你可以通过全选来设置所有页面的链接方式和缓存时间</p>
    <p>职位列表页，人才列表页，会员中心页面均不能开启缓存</p>
    <p>系统内内置页面无法删除！</p>
    <p>强烈建议开启页面缓存，缓存让系统性能显著提高！</p>
    <p class="link_green_line">骑士人才系统支持多种URL样式，无论您是<strong>asp , aspx , jsp ，shtml , ......</strong>程序都可以完美转换为骑士系统，且URL可以保持不变，具体请咨询<a href="http://www.74cms.com" target="_blank">骑士客服</a></p>
</div>
  <notempty name="apply['Subsite']">
  <div class="seltpye_x">
      <div class="left">所属分站</div>
      <qscms:subsite 列表名="subsite_list"/>
      <div class="right">
        <if condition="$visitor['role_id'] eq 1">
          <volist name="subsite_list" id="subsite">
            <a href="{:P(array('subsite_id'=>$subsite['s_id']))}" <if condition="$Think.get.subsite_id eq $subsite['s_id'] or ($Think.get.subsite_id eq 0 and $subsite['s_id'] eq 0)">class="select"</if>>{$subsite.s_sitename}</a>
          </volist>
        <else/>
          <volist name="subsite_list" id="subsite">
            <if condition="in_array($subsite['s_id'],$visitor['subsite'])">
              <a href="{:P(array('subsite_id'=>$subsite['s_id']))}" <if condition="$Think.get.subsite_id eq $subsite['s_id']">class="select"</if>>{$subsite.s_sitename}</a>
            </if>
          </volist>
        </if>
        <div class="clear"></div>
      </div>
      <div class="clear"></div>
  </div>
  </notempty>
<form action="{:U('set_url')}" method="post"  name="form1" id="form1">
    <div class="list_th">
        <div class="td" style=" width:30%;">
            <label id="chkAll" class="left_padding">
                <input type="checkbox" name="chkAll" id="chk" title="全选/反选"/>页面名称
            </label>
        </div>
        <div class="td" style=" width:30%;">调用名</div>
        <div class="td center" style=" width:10%;">类型</div>
        <div class="td center" style=" width:10%;">链接</div>
        <div class="td center" style=" width:10%;">缓存</div>
        <div class="td" style=" width:10%;">编辑</div>
        <div class="clear"></div>
    </div>
    <volist name="list" id="vo">
        <div class="list_tr link_black">
            <div class="td" style=" width:30%;">
                <div class="left_padding striking">
                    <input name="id[]" type="checkbox" id="id" value="{$vo['id']}"/>
                    {$vo['pname']}
                </div>
            </div>
            <div class="td" style=" width:30%;">{$vo['alias']}</div>
            <div class="td center" style=" width:10%;">
                <if condition="$vo['systemclass'] eq 1">
                    <span style="color: #FF6600">系统内置</span>
                    <else />
                    自定义页面
                </if>
            </div>
            <div class="td center" style=" width:10%;">
                <if condition="$vo['url'] eq 0">原始链接</if>
                <if condition="$vo['url'] eq 1">伪静态</if>
            </div>
            <div class="td center" style=" width:10%;">
                <if condition="$vo['caching'] eq 0">
                    <span style="color:#999999">已关闭</span>
                    <else />
                    <em>{$vo['caching']}</em> 分
                </if>
            </div>
            <div class="td edit" style=" width:10%;">
                <a href="{:U('edit',array('id'=>$vo['id']))}">修改</a>
                <if condition="$vo['systemclass'] neq 1">
                    <a href="{:U('delete',array('id'=>$vo['id']))}" class="gray" onclick="return confirm('你确定要删除吗？')">删除</a>
                </if>
            </div>
        </div>
    </volist>
    <input type="hidden" name="url" id="url" value="">
    <input type="hidden" name="caching" id="caching" value="">
</form>
<empty name="list">
    <div class="list_empty">没有任何信息！</div>
</empty>
<div class="list_foot">
    <div class="btnbox">
        <input name="add" type="button" class="admin_submit" id="add" value="添加页面"  onclick="window.location='{:U('add')}'"/>
        <input type="button" name="open" value="设置链接" class="admin_submit"  id="SetUrl"/>
        <input type="button" name="open1" value="设置缓存" class="admin_submit"  id="SetCaching"/>
        <input type="button" name="ButDel" id="ButDel" value="删除页面" class="admin_submit"   />
    </div>
</div>
<div class="pages">{$page}</div>
</div>
<include file="public:footer" />
<script type="text/javascript">
    $(document).ready(function() {
      // 批量设置链接
      $("#SetUrl").click(function () {
        var ids = $("input[name='id[]']:checked");
        if (!ids.length) {
          disapperTooltip('remind','您没有选择页面！');
          return false;
        }
        var qsDialog = $(this).dialog({
          title: '请选择',
          loading: true,
          footer : false
        });
        var url = "{:U('Ajax/page_set_url')}";
        $.post(url, function (result) {
          if(result.status == 1){
            qsDialog.setContent(result.data);
            $("#set_url").live('click',function(){
              $('#url').val($('#J_url').val());
              $("form[name=form1]").submit()
            })
          } else {
            qsDialog.hide();
            disapperTooltip('remind',result.msg);
          }
        });
      })
      // 批量设置缓存
      $("#SetCaching").click(function () {
        var ids = $("input[name='id[]']:checked");
        if (!ids.length) {
          disapperTooltip('remind','您没有选择页面！');
          return false;
        }
        var qsDialog = $(this).dialog({
          title: '设置缓存',
          loading: true,
          footer : false
        });
        var url = "{:U('Ajax/page_set_caching')}";
        $.post(url, function (result) {
          if(result.status == 1){
            qsDialog.setContent(result.data);
            $("#set_caching").live('click',function(){
              $('#caching').val($('#J_caching').val());
              $("form[name=form1]").attr("action","{:U('set_caching')}");
              $("form[name=form1]").submit();
            })
          } else {
            qsDialog.hide();
            disapperTooltip('remind',result.msg);
          }
        });
      })
      //点击批量删除
      $("#ButDel").click(function(){
        var ids = $("input[name='id[]']:checked");
        if (!ids.length) {
          disapperTooltip('remind','您没有选择页面！');
        } else {
          if (confirm('你确定要删除吗？')) {
            $("form[name=form1]").attr("action","{:U('delete')}");
            $("form[name=form1]").submit()
          }
        }
      })
    })
</script>
</body>
</html>